using System;
using System.Collections.Generic;
using System.Text;

namespace LeisureCenter.Api
{
    public interface IPlaylistItem : IMedia, IPositionableMedia, ISearchableMedia, IVisualMedia, IControllableMedia
    {
        string Text { get; }

        bool Played { get; set; }

        int Index { get; }

        void StepBackward();
        void StepForward();
        void BigStepBackward();
        void BigStepForward();
    }

    public interface IPlaylist : IEnumerable<IPlaylistItem>
    {
        IPlaylistItem this[int index] { get; }
        int Count { get; }

        IPlaylistItem ActivePlaylistItem { get; }
        int ActivePlaylistItemIndex { get; set; }
        IPlaylistItem ActivePlaylistItemOrStub { get; }

        void Previous();
        void Next();
    }

    [Flags()]
    public enum PlayMode
    {
        None = 0,
        Random = 1,
        Repeat = 2
    }

    public interface IPlaylistManager
    {
        PlayMode PlayMode { get;}

        IPlaylist Playlist { get; }

        void AddFromFileNames(IEnumerable<string> fileNames, bool clearPlaylist);
        void AddFromFileName(string fileName, bool clearPlaylist);

        void OpenVideoDvd(string path);
        void OpenAudioCd(string drive);

        void Clear();
        void Stop();

        event EventHandler PlayModeChanged;
        event EventHandler PlaylistChanged;
        event EventHandler<PlayStateChangeEventArgs> PlayStateChanged;
        event EventHandler ActivePlaylistItemChanged;
        event EventHandler PositionChanged;
    }
}
